package com.wjw.java.io.print;

import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * 字符打印流:
 */
public class PrintWriter_ {

    public static void main(String[] args) {
        PrintWriter pw = new PrintWriter(System.out);
        pw.println("控制台打印输出。。");
        pw.close();
        try {
            PrintWriter pw2 = new PrintWriter(new FileWriter("f:\\IO\\log2.txt"));
            pw2.println("输出到txt文档中。。");
            pw2.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
